import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import p002 from './p002';
import format from '@dfeidao/atom-web/dt/format';
interface Par extends Event {
	page_no: number;
}
export default async function a001(fd: IFeidaoAiBrowserComponent,e: Par) {
	// todo

	const res = await nodejs<{dt1: Array<{exam_name: string;start_time: number;
		examination_category: string;exam_time: string;exam_score: string;
		finish_time: number}>,t: number}>('examination-management/zj-000001/s001', {
		filter:{
			page_no:e.page_no
		}});
		const ren = res.dt1.map((n) => {
			return {...n,start_time:format(n.start_time,2),finish_time:format(n.finish_time,2)};
		});
	if (res.dt1.length > 0 ) {
		render(fd,ren,p001,'p001','inner');
	} else {
		render(fd,"",p002,'p002','inner');
	}
}
